package com.geekcoding.geekoj.utils;

import cn.hutool.json.JSONUtil;

import java.util.Objects;

public class Json {

    public static <T> T convert(Object obj, Class<T> clazz) {
        if (Objects.isNull(obj)) {
            return null;
        }
        return JSONUtil.toBean(JSONUtil.toJsonStr(obj), clazz);
    }
}
